//
//  YYT_AboutMVTableViewCell.m
//  AudioVisualFeast
//
//  Created by 张琪 on 16/1/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YYT_AboutMVTableViewCell.h"
#import <UIImageView+WebCache.h>

@interface YYT_AboutMVTableViewCell ()
@property (nonatomic, retain) UIImageView *imageview;

@property (nonatomic, retain) UILabel *name;
@property (nonatomic, retain) UILabel *times;

@end
@implementation YYT_AboutMVTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageview = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self addSubview:self.imageview];
        _imageview.contentMode = UIViewContentModeScaleAspectFill;
        self.imageview.clipsToBounds = YES;
        self.title = [[UILabel alloc] initWithFrame:CGRectZero];
        self.title.font = [UIFont systemFontOfSize:13];
        [self addSubview:self.title];
        self.name = [[UILabel alloc] initWithFrame:CGRectZero];
        self.name.font = [UIFont systemFontOfSize:13];
        self.name.textColor = [UIColor colorWithRed:30 / 255.0 green:195 / 255.0 blue:153 / 255.0 alpha:1.0];
        [self addSubview:self.name];
        self.times = [[UILabel alloc] initWithFrame:CGRectZero];
        self.times.textColor = [UIColor grayColor];
        self.times.font = [UIFont systemFontOfSize:13];
        [self addSubview:self.times];
    }
    return self;
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.imageview.frame = CGRectMake(10, 10, 165, 80);
    self.title.frame = CGRectMake(175, 20, self.bounds.size.width - 175, 13);
    self.name.frame = CGRectMake(175, 40, self.bounds.size.width - 175, 13);
    self.times.frame = CGRectMake(175, 60, self.bounds.size.width - 175, 13);
}
- (void)setModelShared:(YYT_ModleShared *)modelShared{
    _modelShared = modelShared;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:_modelShared.playListPic] placeholderImage:[UIImage imageNamed:@"zhanweitu.png"]];
    self.title.text = _modelShared.title;
    self.name.text = _modelShared.artistName;
    self.times.text = [NSString stringWithFormat:@"播放次数:%@", _modelShared.totalViews];
}

- (void)setPeopleModel:(YYT_PeopleModel *)peopleModel{
    _peopleModel = peopleModel;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:_peopleModel.thumbnailPic] placeholderImage:[UIImage imageNamed:@"zhanweitu.png"]];
    self.title.text = _peopleModel.title;
    self.name.text = _peopleModel.artistName;
    self.times.text = [NSString stringWithFormat:@"播放次数:%@", _peopleModel.totalViews];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
